package com.example.demo.task;


import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Task2 {
	
		private static final SimpleDateFormat dateFormate=new SimpleDateFormat();
		@Scheduled(fixedRate=6000)
		private void reportCurrentTime(){
			System.out.println("NowTime:"+dateFormate.format(new Date()));
		}
}
